-- GENERATED SPELL FOR [Morganth] --


function spell0_397(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_397', 0, 1)
end

function spell1_397(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(20811,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_397', 3000, 1)
end

function spell2_397(pUnit, Event) --@Minion of Morganth,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(3611,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_397', 1, 1)
end

function spell3_397(pUnit, Event) --@Summon Succubus,Self--
pUnit:FullCastSpellOnTarget(8722,pUnit)
pUnit:RegisterEvent('Sorts_397', 575, 1)
end

function Sorts_397(pUnit, Event)
local choix_sorts_397 = math.random(0, 3)
if choix_sorts_397 == 0 then
pUnit:RegisterEvent('spell0_397', 1, 1)
end
if choix_sorts_397 == 1 then
pUnit:RegisterEvent('spell1_397', 1, 1)
end
if choix_sorts_397 == 2 then
pUnit:RegisterEvent('spell2_397', 1, 1)
end
if choix_sorts_397 == 3 then
pUnit:RegisterEvent('spell3_397', 1, 1)
end
end

function mob397_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_397', math.random(1500, 3000), 1)
end

function mob397_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob397_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob397_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(397, 1, 'mob397_Action')
RegisterUnitEvent(397, 2, 'mob397_Leave')
RegisterUnitEvent(397, 3, 'mob397_Kill')
RegisterUnitEvent(397, 4, 'mob397_Die')
